<?php $id = getId();?>
<div id="<?php _e($id);?>">
<div>
	<form onsubmit="return false">
	<input type="text" style="width:150px" class="x-text"/>
	<button style="padding:3px;cursor:pointer" onclick="addContactLabel(this,'<?php _e($id)?>')">Tạo nhãn mới</button>
	</form>
	<?php $this->e('message','<div style="color:red;padding:5px 0px">','</div>')?>		
</div>
<?php if( count($this->get('labels')) > 0 ):?>
<div style="padding:10px 0px">
<?php foreach( $this->get('labels') as $a ):?>
<table cellpadding="5" border="1" bordercolor="#cccccc" width="100%" style="margin-bottom:3px">
<tr>
	<td>
		<?php $pid = getId();?>
		<div id="<?php _e($pid);?>1">
			<?php _e($a['label']);?>
		</div>
		<div id="<?php _e($pid);?>2" style="display:none">
			<form onsubmit="return false">
			<input type="text" value="<?php _e($a['label']); ?>" style="width:150px" class="x-text"/>
			<button style="padding:3px;cursor:pointer" onclick="editContactLabel(this,'<?php _e($a['ID']);?>','<?php _e($id)?>')">Cập nhập</button>
			</form>
		</div>
	</td>
	<td width="60" align="center">
		<small><a onclick="showFormEditContactLabel(this,'<?php _e($pid)?>')">Sửa</a> | 
		<a onclick="deleteContactLabel('<?php _baseUrl();?>/Contact/Index/Label?ID=<?php _e($a['ID'])?>','<?php _e($id);?>')">Xóa</a></small>
	</td>
</tr></table>
<?php endforeach;?>
</div>
<?php else:?>
<div style="padding:10px">
<i>Chưa có nhãn nào được tạo</i>
</div>
<?php endif;?>
</div>